<?php        
    class TrainingProgramModel extends Model {
        public static $classDesc = "Training program";
        
        public static $keyDesc = array(
            "id"            => "ID",
            "hashid"        => "Hashid",
            "userid"        => "User ID",
            "from_userid"   => "From user ID",
            "program_name"  => "Program name",
            "startdate"     => "Start date",
            "enddate"       => "End date",
            "accepted"      => "Accepted",
            "updated"       => "Updated",
            "rowstamp"      => "Created"
        );
        
        public function __construct($id = null) {
            $this->_childClass["training_program_record"]           = "TrainingProgramRecordModel";
            $this->_childClass["training_program_template_link"]    = "TrainingProgramTemplateLinkModel";
            $this->_childClass["training_program_schedule"]         = "TrainingProgramScheduleModel";
            
            $this->_childs["training_program_record"]           = null;
            $this->_childs["training_program_template_link"]    = null;
            $this->_childs["training_program_schedule"]         = null;
            
            $this->_foreignIdCol    = "training_programid";
            $this->_table           = "training_program";
            
            parent::__construct($id);
            
            # Tekstikenttien minimipituus
            parent::$_schema["training_program"]["program_name"]["minlength"] = 1;
        }
    }